﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Shared.Models.SshWebSocket.Response
{
    public class SshWebSocketResponse<T>
    {
        public bool Success { get; set; }
        public string Error { get; set; }
        public T SshResponse { get; set; }

        public static SshWebSocketResponse<T> SuccessData()
        {
            return new SshWebSocketResponse<T>()
            {
                Success = true,
            };
        }

        public static SshWebSocketResponse<T> SuccessData(T response)
        {
            return new SshWebSocketResponse<T>()
            {
                Success = true,
                SshResponse = response
            };
        }

        public static SshWebSocketResponse<T> ErrorData()
        {
            return new SshWebSocketResponse<T>()
            {
                Success = false,
            };
        }
        public static SshWebSocketResponse<T> ErrorData(string errMsg)
        {
            return new SshWebSocketResponse<T>()
            {
                Success = false,
                Error = errMsg
            };
        }
    }
}
